<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var a = 1   // 只有 var 声明的变量才能挂在 window对象 下

    function test() {
        const a = 2
        console.log(this)   // window
        console.log(this.a);    // 1
    }

    test()
</script>
</body>
</html>
